#include <iostream>
#include <conio.h>
#include <new>

int main()
{
	int lengt_array = 0,
		max1 = 0,
		max2 = 0,
		max1_index = 0;

	int *vect;
	
	do{
		std::cout << "how many members would you like = " ;
		std::cin >> lengt_array;
		if(lengt_array <= 1)
		{
			std::cout << "your input number most be greater then 1 " << std::endl;
		}
	}
	while(lengt_array <= 1);
	vect= new  int[lengt_array];
	for(int i = 0 ; i <lengt_array ; ++i)
	{
		std::cout << "vect[" << i << "] = ";
		std::cin >>vect[i];
	}	
	max1 = vect[1] ; 
	max2 = vect[1] ; 
	for(int i = 0; i < lengt_array ; ++i)
	{
		if(vect[i] > max1){
			max1 = vect[i];
			max1_index = i;
		}
	}
	for(int i = 0; i < lengt_array ; ++i)
	{
		if(i != max1_index)
		{
		if(vect[i] > max2){
			max2 = vect[i];
		}
		}
	}

	std::cout << "max1 = " << max1 << std::endl;
	std::cout << "max2 = " << max2 << std::endl;

	getch();
	delete [] vect;
	return 0;
}